<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>判断是否是移动端</title>
</head>
<body>
<script>
const isMobile = function(){ return 'ontouchstart' in window }();
console.log(isMobile)
</script>
	
</body>
</html>